/*
    Document   : order.js
    Created on : Nov 26, 2012
    Author     : HongDC
*/

// check login before redirect to Order page
function reqOrderPage() {
    if (checkLogin()) {
        location.href = "OrderController?action=Orders";
    } else {
        toggleDialog('#dAccount');
    }
}

// add an event listener to each element in class btnAddCart
forEach.call($$(".aOrderId"), function(el) {
    el.addEventListener('click', function(e) {
        var href = e.target.href;
        var orderId = e.target.innerHTML;

        href += "?orderId="+orderId+"&action=View";
        window.location.href = href;
        e.preventDefault();
    }, false);
});